package com.topvision.myviewtest.utils;

import android.content.Context;
import android.widget.Toast;

/**
 * Author: lucy
 * Comment: //TODO
 * Date: 2017-12-01 11:35
 */

public class ToastUtils {
    private static Toast sToast;
    public static void showToast(Context context, String text) {
        if (sToast == null) {
            synchronized (ToastUtils.class) {
                if (sToast == null) {
                    sToast = Toast.makeText(context.getApplicationContext(), text, Toast.LENGTH_SHORT);
                }
            }
        }
        sToast.setText(text);
        sToast.show();
    }
}
